package com.neuedu.corejava.ch10;

public class Computer implements Comparable<Computer>{
	// 品牌
	private String brand;
	// 价格
	private double price;

	public Computer() {
		super();
	}

	
	@Override
	public String toString() {
		return "Computer [brand=" + brand + ", price=" + price + "]";
	}


	public Computer(String brand, double price) {
		super();
		this.brand = brand;
		this.price = price;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}


	@Override
	public int compareTo(Computer o) {
		// 根据品牌进行排序
		return this.brand.hashCode()-o.getBrand().hashCode();

	}
	

	


	
	

}
